package com.mysoft.gfyx.clue.controller;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.clue.mip.dto.GetDeveloperContactsRequestDto;
import com.mysoft.gfyx.clue.remoteservice.RemoteRadarService;
import com.mysoft.gfyx.clue.remoteservice.dto.PickContactsDto;
import com.mysoft.gfyx.clue.remoteservice.dto.ViewTelNumberRequestDto;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@PubService(value = "/provinceRadarDataApi", prefix = RequestPrefix.API)
@Tag(name = "省市雷达-API")
public class ClueProvinceRadarDataApiController extends Controller implements DataApi {

    @Autowired
    private RemoteRadarService remoteRadarService;

    @PubAction(value = "/viewTelNumber", method = RequestMethod.POST)
    public boolean viewTelNumber(@RequestBody ViewTelNumberRequestDto dto) {
        remoteRadarService.viewTelNumber(dto);
        return true;
    }

    @PubAction(value = "/getContact", method = RequestMethod.POST)
    public List<PickContactsDto> getContact(@RequestBody GetDeveloperContactsRequestDto dto) {
        return remoteRadarService.getContacts(dto);
    }
}
